//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
//#pragma comment(linker,"/STACK:33554432") /*32Mb*/
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<numeric>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<memory>
#include<string>
#include<vector>
#include<cctype>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
using namespace std;

typedef unsigned long long      ui64;
typedef long long               i64;
typedef	vector<int>             VI;
typedef	vector<bool>            VB;
typedef	vector<VI>              VVI;
typedef	vector<string>          VS;
typedef	pair<int,int>           PII;
typedef map<string,int>         MSI;
typedef set<int>                SI;
typedef set<string>             SS;
typedef map<int,int>            MII;
typedef	pair<double,double>     PDD;

#define PB                      push_back
#define MP                      make_pair
#define X                       first
#define Y                       second
#define FOR(i, a, b)            for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)           for(int i = (a) - 1; i >= (b); --i)
#define CLEAR(a, b)             memset(a, b, sizeof(a))
#define SZ(a)                   int((a).size())
#define ALL(a)                  (a).begin(), (a).end()
#define RALL(a)                 (a).rbegin(), (a).rend()
#define INF                     (2000000000)





int main()
{


	string s1,s2;
	string s;//('a',4000);
	cin >> s;
	int n = SZ(s);

	vector<int> d1 (n);
	int l=0, r=-1;
	for (int i=0; i<n; ++i) {
		int k = (i>r ? 0 : min (d1[l+r-i], r-i)) + 1;
		while (i+k < n && i-k >= 0 && s[i+k] == s[i-k])  ++k;
		d1[i] = --k;
		if (i+k > r)
			l = i-k,  r = i+k;
	}
	vector<int> d2 (n);
	l=0, r=-1;
	for (int i=0; i<n; ++i) {
		int k = (i>r ? 0 : min (d2[l+r-i+1], r-i+1)) + 1;
		while (i+k-1 < n && i-k >= 0 && s[i+k-1] == s[i-k])  ++k;
		d2[i] = --k;
		if (i+k-1 > r)
			l = i-k,  r = i+k-1;
	}

	VI dp(n,0);
	VI from(n,0);
	dp[0] = 1;
	FOR(i,1,n) {
		dp[i] = dp[i-1]+1;
		from[i] = i;
		s1 = s.substr(0,i+1);
		s2 = s1;
		reverse(ALL(s1));
		if(s1==s2) {
			dp[i] = 1;
			from[i] = 0;
		}
		FOR(j,i/2,i+1) {
			if( j+d1[j] >= i ) {
				if(2*j-i-1<0) {
					//continue;
					dp[i] = 1; from[i] = 0;
				}
				else
					if( dp[i] > dp[2*j-i-1]+1 ) {
						dp[i] = min(dp[i],dp[2*j-i-1]+1);
						from[i] =  2*j-i;
					}
			}
			if( j+d2[j]-1 >= i ) {
				if(2*j-i-2<0)
				{
					//continue;
					dp[i] = 1; from[i]=0;
				}
				else
					if( dp[i] > dp[2*j-i-2]+1 ) {
						dp[i] = min(dp[i],dp[2*j-i-2]+1);
						from[i] =  2*j-i-1;
					}
			}
			/*
			s1 = s.substr(i-j,j+1);
			s2 = s1;
			reverse(ALL(s2));
			if( s1==s2 ) {
			if( dp[i] > dp[i-j-1]+1 ) {
			dp[i] = min(dp[i],dp[i-j-1]+1);
			from[i] =  i-j;
			}
			}*/
		}
	}
	cout << dp[n-1] << endl;
	int prev = n-1;
	int it = from[prev];
	VS ans;
	//cout << s.substr(1,0) << "." << endl; 
	while(it>=0) {
		ans.PB(s.substr(it,prev-it+1));
		prev = it-1;
		if(it<=0)
			break;
		it = from[it-1];
	}
	reverse(ALL(ans));
	FOR(i,0,SZ(ans)) {
		cout << ans[i] << " ";
		//printf("%s%c", ans[i],i==SZ(ans)-1?'\n':' ');
	}
	cout << endl;
	return 0;
}